local factorial = {}

function factorial.func(x)
    if x == 1 then
        return 1
    else
        return x * factorial.func(x - 1)
    end
end

print("please input a number:")
local n = io.read("*n")
print(factorial.func(n))
